package gui.ulohy;

import gui.skolnikwin.SkolnikWinManager;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.JButton;
import javax.swing.JDialog;

/**
 * Reprezentuje ulohu s matematikou.
 * @author schovjan
 * @date Jan 9, 2012
 */
public class Matematika extends JDialog {

    private static final long serialVersionUID = 1L;
    private SkolnikWinManager winManager = null;
    private Dimension velikost = new Dimension(500, 600);
    private JButton btnKonec = new JButton("Ukončit matematiku");


    /**
     * Konstruktor
     */
    public Matematika(SkolnikWinManager winManager) {
	super();
	this.winManager = winManager;
	createGUI();
    }


    /**
     * Vytvoreni GUI
     */
    private void createGUI() {
	this.setLayout(null);
	this.setPreferredSize(velikost);
	this.setMaximumSize(velikost);
	this.setBackground(Color.green);
	// konec matematiky
	btnKonec.addActionListener(new AbstractAction() {

	    private static final long serialVersionUID = 1L;


	    @Override
	    public void actionPerformed(ActionEvent e) {
		setVisible(false);
	    }
	});
	btnKonec.setBounds(100, 310, 100, 30);
	this.add(btnKonec);
    }


    /**
     * Vrati velikost panelu
     * @return
     */
    public Dimension getVelikostPanelu() {
	return velikost;
    }
}
